home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / tex / dvivga9.zip / GENDEFS.H < prev    next >
C/C++ Source or Header  |  1988-05-30  |  4KB  |  114 lines

  1. /* -*-C-*- gendefs.h */
  2. /*-->gendefs*/
  3. /**********************************************************************/
  4. /****************************** gendefs *******************************/
  5. /**********************************************************************/
  6.  
  7. /**********************************************************************/
  8. /************************  General Definitions  ***********************/
  9. /**********************************************************************/
  10.  
  11. /***********************************************************************
  12. This section should not require modification for either new hosts or new
  13. output devices.
  14. ***********************************************************************/
  15.  
  16. #define  ABS(x)        ((x) < 0 ? -(x) : (x))
  17. #define  DBGOPT(flag)    (debug_code & (flag))
  18. #define  DBG_PAGE_DUMP    0x0001
  19. #define  DBG_CHAR_DUMP    0x0002
  20. #define  DBG_POS_CHAR    0x0004
  21. #define  DBG_OKAY_OPEN    0x0008
  22. #define  DBG_FAIL_OPEN    0x0010
  23. #define  DBG_OFF_PAGE    0x0020
  24. #define  DBG_FONT_CACHE    0x0040
  25. #define  DBG_SET_TEXT    0x0080
  26. #define  DEBUG_OPEN(fp,fname,openmode) dbgopen(fp,fname,openmode)
  27. #define  DVIFORMAT      2
  28. #define  FIRSTPXLCHAR      0
  29. #define  FT_GF        0
  30. #define  FT_PK        1
  31. #define  FT_PXL        2
  32. #define  IN(a,b,c)    (((a) <= (b)) && ((b) <= (c)))
  33.  
  34. /* Computer Modern has 128 characters (0..127), but Japanese fonts and
  35. extended European Computer Moderns may have up to 256 (0..255)
  36. characters */
  37. #define  LASTPXLCHAR    255
  38.  
  39. #define  MAGSIZE(f)    ((UNSIGN32)(1000.0*(f) + 0.5))
  40.  
  41. #ifdef MAX
  42. #undef MAX
  43. #endif
  44.  
  45. #define  MAX(a,b)    ((a) > (b) ? (a) : (b))
  46. #define  MAXFONTS       32   /* number of fonts per job (HPLJ, Canon A2) */
  47. #define  MAXMSG        1024 /* message[] size--big enough for 2 file names*/
  48. #define  MAXPAGE    999  /* limit on number of pages in a DVI file */
  49. #define  MAXREQUEST    256  /* limit on number of explicit page print
  50.                 requests */
  51. #define  MAXSPECIAL    500  /* limit on \special{} string size; it need not
  52.                 be larger than TeX's compile-time parameter
  53.                 buf_siz, which is 500 in Standard TeX-82 */
  54. #define  MAXSTR        257  /* DVI file text string size */
  55.  
  56. #define  MAXFORMATS     12  /* number of font file naming formats */
  57. #define  MIN_M        -500 /* GF character image extents */
  58. #define  MAX_M        1500
  59. #define  MIN_N        -500
  60. #define  MAX_N        1500
  61.  
  62. #ifdef MIN
  63. #undef MIN
  64. #endif
  65.  
  66. #define  MIN(a,b)    ((a) < (b) ? (a) : (b))
  67.  
  68. #if    (OS_ATARI | OS_PCDOS | OS_TOPS20)
  69. #define NEWLINE(fp) {(void)putc((char)'\r',fp);(void)putc((char)'\n',fp);}
  70.                     /* want <CR><LF> for these systems */
  71. #else
  72. #define NEWLINE(fp) (void)putc((char)'\n',fp)    /* want bare <LF> */
  73. #endif
  74.  
  75. #define  NPXLCHARS    256
  76. #define  ONES         ~0  /* a word of all one bits */
  77. #define  OUTC(c)    (void)putc((char)(c),plotfp)
  78. #define  OUTF(fmt,v)    (void)fprintf(plotfp,fmt,v)
  79. #define  OUTF2(fmt,u,v)    (void)fprintf(plotfp,fmt,u,v)
  80. #define  OUTF3(fmt,u,v,w)    (void)fprintf(plotfp,fmt,u,v,w)
  81. #define  OUTS(s)    (void)fputs(s,plotfp)
  82.  
  83. #if    CANON_A2
  84.  
  85. #ifdef CANON_TEST
  86. #define  FOUTC(c)    (void)putc((char)(c),savefp);
  87. #define  FOUTS(s)    (void)fputs(s,savefp)
  88. #endif /* CANON_TEST */
  89.  
  90. #endif
  91.  
  92. #define  PIXROUND(n,c)  ((COORDINATE)(((float)(n))*(c) + 0.5))
  93.  
  94. #undef     PXLID
  95. #define  PXLID           1001
  96.  
  97. #define  SETBIT(m) img_row[(m-min_m) >> 5] |= img_mask[(m-min_m) & 0x1f]
  98. #define  TESTBIT(m) img_row[(m-min_m) >> 5] & img_mask[(m-min_m) & 0x1f]
  99.  
  100. #if    STDRES
  101. #define  STDMAG        1000
  102. #else
  103. #define  STDMAG        603  /* 1500/(1.2**5) to stay in magstep family */
  104. #endif
  105.  
  106. #define  RESOLUTION    (((float)STDMAG)/5.0)    /* dots per inch */
  107. #define  STACKSIZE    100
  108.  
  109. #undef     USEGLOBALMAG
  110. #define  USEGLOBALMAG      1        /* allow dvi global magnification */
  111.  
  112. #define  VISIBLE(t) ((t->wp > 0) && (t->hp > 0))
  113.         /* true if both pixel height and width are non-zero */
  114.